package org.dant.ant.extension.net.processors;

import org.dant.ant.extension.net.Processor;
import org.dant.ant.extension.tasks.internal.RemoteCommand;
import org.dant.ant.extension.tasks.internal.RemoteResponse;
import org.dant.ant.extension.tasks.commands.CommandsConstants;

public class SysInfoProcessor implements Processor {

  public void process(RemoteCommand req, RemoteResponse response) {
    response.setCommandType(req.getName());
    if (CommandsConstants.DANT_CMD_SYSINFO.equals(req.getName())) {
      response.setResult(new SysInfo().toString());
    } else {
      response.setSuccess(false);
      response.setResult("Required a SYSINFO command, but is not a SYSINFOcommand");
    }
  }
}
